/**
 * 项目示例-列表表头
 * Date 2023-5-25 09:33:56
 * 可选参数可参考：https://element-plus.org/zh-CN/component/table.html#table-column-属性
 */

import { xor } from "lodash";

// 数据展示
export const exampleColumns = [
  { type: 'index', label: '序号', width: 60, align: 'center' },
  { prop: 'eventTypeNum', label: '事件类型编号',sortable: 'custom', minWidth: 110, align: 'left' },
  { prop: 'result', label: '后果/影响', minWidth: 100, align: 'center' },
  { prop: 'eventLevel', label: '事件等级', sortable: 'custom', minWidth: 110, align: 'center',
  formatter: function (row: any, column: any, cellValue: any) {
    return cellValue?.name
  }},
  { prop: 'processGroup', label: '区域处置单位', minWidth: 100, align: 'center' ,
  formatter: function (row: any, column: any, cellValue: any) {
    let str = ''
    for(let item of cellValue){
      str += item.name + '  '
    }
    return str
  }},
  { prop: 'eventTypeSource', label: '事件类型来源', minWidth: 100, align: 'center' },
  { prop: 'creator', label: '创建人', minWidth: 100, align: 'center' , formatter: function (row: any, column: any, cellValue: any) {
    return cellValue['name'] ? cellValue['name'] : '-'
  }},
  { prop: 'createTime', label: '创建时间',sortable: 'custom', minWidth: 150, align: 'center' },
  { prop: 'enabled', label: '状态', minWidth: 140, align: 'center' ,sortable: 'custom',
  formatter: function (row: any, column: any, cellValue: number) {
    return cellValue ? '启用' : cellValue === 0 ? '挂起' : '-'
  }},
  { prop: 'action', label: '操作', fixed: 'right', width: 100, align: 'center' }
]

// 模板下载
export const modelColumns = [
  { type: 'index', label: '序号', width: 60, align: 'center' },
  { prop: 'typeName', label: '事件类型', minWidth: 130, align: 'center' },
  { prop: 'action', label: '操作', fixed: 'right', width: 110, align: 'center' }
]
